<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>订单管理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-
scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../css/y_index.css" />
    <link rel="stylesheet" type="text/css" href="../js/drop/dropload.css" />
    <style>

    </style>
</head>

<body>
    <div class="pos_r">
        <ul class="bw flex_a flex_sa bw ptb20 top">
            <li class="colc active" data-id='0'>全部</li>
            <li class="colc" data-id='1'>待发货</li>
            <li class="colc" data-id='2'>待收货</li>
            <li class="colc" data-id='3'>已完成</li>
        </ul>
        <div class="container">
            <div class="mainBox">
                <!-- <div class="bw mt20 list">
                <li class="flex_sb p20 bdb">
                    <span class="col9">订单编号：2132563</span>
                    <span class="c4">待发货</span>
                </li>
                <li class="p20 flex_sb aie">
                    <div class="flex_a">
                        <img src="../img/y_8.png" style="width: 1.5rem;height: 1.5rem;" />
                        <em class="flex flex_column ml20">
                        <span class="font15">清风纸巾</span>
                        <span class="col9 mt20">分类：日用品</span>
                        <span class="c4 mt20">￥2.00</span>
                        </em>
                    </div>
                    <span class="col9">x1</span>
                </li>
                <li class="p20 bdt">共1件商品 合计：<span class="c4">￥10.00</span></li>
            </div> -->
                <!-- <div class="bw mt20 list">
                <li class="flex_sb p20 bdb">
                    <span class="col9">订单编号：2132563</span>
                    <span class="c5">待收货</span>
                </li>
                <li class="p20 flex_sb aie">
                    <div class="flex_a">
                        <img src="../img/y_8.png" style="width: 1.5rem;height: 1.5rem;" />
                        <em class="flex flex_column ml20">
                        <span class="font15">清风纸巾</span>
                        <span class="col9 mt20">分类：日用品</span>
                        <span class="c4 mt20">￥2.00</span>
                        </em>
                    </div>
                    <span class="col9">x1</span>
                </li>
                <li class="p20 bdt">共1件商品 合计：<span class="c4">￥10.00</span></li>
            </div> -->
            </div>
        </div>
    </div>
</body>

</html>
<script src="../js/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/dlc.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/drop/dropload.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
<script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.0/alipayjsapi.inc.min.js"></script>
<!--公司的常用函数封装-->
<script type="text/javascript">
// dlc_request('/goods/goodsCategoryList', {}, function(res) {
//     console.log(res);
//     if (res.code == 1) {

//     } else {
//         dlctipbox.show(res.msg);
//     }
// })
var page = 0,
    limit = 10,
    hui;
getList(0);
$('.top').on('click', 'li', function() { //菜单点击事件
    $(this).addClass('active').siblings().removeClass('active');
    var id = $(this).data('id');
    page = 0;
    getList(id);
})

function getList(id) {
    //内容列表
    $('.container').dropload({
        scrollArea: window,
        loadDownFn: function(me) {
            // $('.dropload-down').remove();
            page++;
            dlc_request('/api/myOrder/MyOrderlList', { status: id, page: page, limit: limit }, function(res) {
                console.log(res);
                if (res.code == 1) {
                    var str = '';
                    var list = res.data.list;
                    if (list.length > 0) {
                        list.forEach((item, index) => {
                            str += '<div class="bw mt20 list"> <li class="flex_sb p20 bdb"> <span class="col9">订单编号：' + item.orderNo + '</span> <span class="col9">' + (id = 0 ? '已完成' : id = 1 ? '待发货' : id = 2 ? '待收货' : '已完成') + '</span> </li> <li class="p20 flex_sb aie"> <div class="flex_a"> <img src="' + item.imgUrl + '" style="width: 1.5rem;height: 1.5rem;" /> <em class="flex flex_column ml20"> <span class="font15">' + item.goodsName + '</span> <span class="col9 mt20">分类：' + item.name + '</span> <span class="c4 mt20">￥' + item.goodsInfo[0].price + '</span> </em> </div> <span class="col9">x' + item.goodsNum + '</span> </li> <li class="p20 bdt">共' + item.goodsNum + '件商品 合计：<span class="c4">￥' + Number(item.goodsSum).toFixed(2) + '</span></li> </div>'
                        })
                    } else {
                        // 锁定
                        me.lock();
                        // 无数据
                        me.noData();
                    }
                    // 插入数据到页面，放到最后面
                    $('.mainBox').html(str);

                    // 每次数据插入，必须重置
                    me.resetload();
                } else {
                    dlctipbox.show(res.msg);
                }
            })
        }
    });
}
</script>